﻿using System;
using System.Collections.Generic;
using System.Text;
using Cemit.PolyProto;
using Google.Protobuf;

namespace Cemit.PolyServer.Game
{
    [System.Obsolete("效率过低，采用重连方案一次性重新发送当前游戏所有的帧信息")]
    public class OperationFrameReply : IMessageHandle<R>
    {
        public void Execute(ClientState clientState, IMessage message)
        {
            if (!clientState.IsLogin)
            {
                this.Log("该玩家还未登录，传来的帧信息视为无效: " + clientState.player.ID);
                return;
            }

            R operationFrameReply = this.AsMessage(message);

            GameServer.Instance
                .GetRoom(operationFrameReply.RoomId)
                .Reply(clientState.player.ID, operationFrameReply.MaxIndex);
        }
    }
}
